home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 145 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.5 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What's so different about 2-D arrays???
  5. Date: Tue, 02 Jan 96 20:53:36 GMT
  6. Organization: none
  7. Message-ID: <820616016snz@genesis.demon.co.uk>
  8. References: <820451938.20697@fredblog.demon.co.uk> <4c799b$q9d@umbc9.umbc.edu> <4ca3j0$fsj@zippy.cais.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4ca3j0$fsj@zippy.cais.net>
  15.            mgeiger@drsystems.com "Mark Geiger" writes:
  16.  
  17. >schlein@umbc.edu (Jonas J. Schlein) wrote:
  18. >
  19. >[snip]
  20. >
  21. >>|> 
  22. >>|> //My own chess recorder program
  23. >
  24. >>Illegal comment! This is comp.lang.c not comp.lang.c++.
  25. >
  26. >Give me a break.
  27.  
  28. Give the people to are trying to help a break. Once of the basic procedures
  29. in analysing somebody's code is compiling it. It is basic courtesy to post
  30. valid C code what will compile on a C compiler. In C //M is a syntax error.
  31. Presumably the original poster didn't know this so it is helpful to point
  32. it out.
  33.  
  34.  
  35. >>|> #include <stdio.h>
  36. >>|> #include <ctype.h>
  37. >
  38. >>Why do you need <ctype.h>?
  39. >
  40. >What difference does it make?
  41.  
  42. It may suggest a misunderstanding on the part of the original poster, or
  43. imply the existence of something not shown in the original post. It is
  44. best to post minimal code, extraneous code just serves to confuse.
  45.  
  46. >>|> /*Prototypes*/
  47. >>|> void setup(char pos[8][8]);   
  48. >>|> 
  49. >>|> void main()
  50. >
  51. >>Please read the FAQ. This will show you why 'int main (void)' is the correct
  52. >>declaration for your particular program.
  53. >
  54. >Couldn't you have put this a bit more constructively?
  55.  
  56. I don't see how. Reading the FAQ is probably the best thing the original
  57. poster could possibly do. The FAQ exists so that its contents don't need
  58. to be repeated in the newsgroup.
  59.  
  60. >>|> {
  61. >>|> char pos[8][8];
  62. >>|> 
  63. >>|>     setup(pos);
  64. >>|> 
  65. >>|> 
  66. >>|>     printf("\nWell Done!!");
  67. >
  68. >>A simple 'return (0);' would go here nicely.
  69. >
  70. >Not the way it was coded...main is a void function.
  71.  
  72. No, in C main is a function that returns int. Once the illegal void main()
  73. line is fixed the return (0); is a natural addition.
  74.  
  75. > Yes, I know that
  76. >he should return an explicit value and not some random garbage, but
  77. >sarcasm is seldom helpful.
  78.  
  79. There was no sarcasm here, just a simple improvement to the program. As you
  80. imply it isn't necessary for a program to be strictly correct but it is
  81. very desirable.
  82.  
  83. >>|> }
  84. >>|> 
  85. >>|> void setup(char pos[8][8])
  86. >
  87. >>What exactly do you think an array is and how do you believe it is
  88. >>supposed to be indexed? In C arrays start at 0 so an array with
  89. >>8 elements is indexed from 0-7 not 1-8. This is true for each and
  90. >>every dimension of a multi-dimensional array.
  91. >
  92. >IMHO, this is the only valuable paragraph in your post, but we could
  93. >have done without the first sentence.
  94.  
  95. Possibly. In my experience it is often easy to read a post in a worse light
  96. than intended.  I don't know what Jonas intended but taken at face value
  97. it is a useful question to ask yourself (a general rather than specific
  98. 'you').
  99.  
  100. >My point in responding in this manner is that people should be able to
  101. >ask questions in this forum without being subjected to ridicule and
  102. >petty criticism.
  103.  
  104. It is also important to recognise the help that is being given.
  105.  
  106. -- 
  107. -----------------------------------------
  108. Lawrence Kirby | fred@genesis.demon.co.uk
  109. Wilts, England | 70734.126@compuserve.com
  110. -----------------------------------------
  111.